package com.example.myblog;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @BelongsProject: MySSM1
 * @BelongsPackage: com.example.myssm1.controller
 * @ClassName DatabaseConnectionTest
 * @CreateTime: 2025-05-22  20:46
 * @Author: TangLiFei
 */
public class DatabaseConnectionTest {
    public static void main(String[] args) {
        String jdbcUrl = "jdbc:mysql://localhost:3306/db_ssm?useSSL=false";
        String username = "root";
        String password = "1qazxsw2";
        try {
            Connection connection = DriverManager.getConnection(jdbcUrl, username, password);
            System.out.println("Connected to MySQL database");
            connection.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
